<?php
namespace app\common\model;

use think\Model;

/**  YSF
 *   合同模板模型
 *   Date: 2019/3/19
 * Class ContractTemplateModel
 * @package app\common\model
 */
class ContractTemplateModel extends Model
{
    // 表名
    protected $name = 'contract_template';

    // 列表查询
    public function getAll($where=[],$field='*',$page=1,$pageSize=999,$order='template_id desc')
    {
		if($pageSize<0){
			  $result = $this->where($where)
                    ->field($field)
                    ->order($order)
                    ->select();
		}else{
			  $result = $this->where($where)
                    ->field($field)
                    ->page($page, $pageSize)
                    ->order($order)
                    ->select();
		}
      
        return $result;
    }

    // 单条查询
    public function getOne($where=[],$field='*')
    {
        $result = $this->where($where)
                    ->field($field)
                    ->find();
        return $result;
    }







}